#!/bin/env perl

use strict;
use warnings;
use Tk qw(:eventtypes);

my $window = Tk::MainWindow->new();

while (Tk::MainWindow->Count()) 
{
	if (Tk::DoOneEvent(DONT_WAIT|WINDOW_EVENTS))
	{
		print "window event\n";
	}

	if (Tk::DoOneEvent(DONT_WAIT|FILE_EVENTS))
	{
		print "file event\n";
	}
 
	if (Tk::DoOneEvent(DONT_WAIT|TIMER_EVENTS))
	{
		print "timer event\n";
	}

	if (Tk::DoOneEvent(DONT_WAIT|IDLE_EVENTS))
	{
		print "idle event\n";
	}
}
